/*
 * @Author: wuzhouhai wzh200x@126.com
 * @Date: 2024-03-20 14:30:20
 * @LastEditors: wuzhouhai wzh200x@126.com
 * @LastEditTime: 2024-04-03 10:12:09
 * @FilePath: \phoenix-client-damo\assets\src\phoenix\utils\Utils.Http.ts
 * @Description: 
 */
import { Utils } from "./Utils";
export class UtilsHttp {
    public static generateRequestSign(url, data, secret):object{
        let signStr = '';
        let sortKeys = Object.keys(data).sort()
        let requestData = {}
        for (let i in sortKeys) {
            let key = sortKeys[i];
            requestData[key] = data[key];
            if (key == 'sign'){
                continue;
            }
            signStr += key + '=' + data[key] + '&';
        }
        signStr += 'url=' + url + '&';
        signStr += 'key=' + secret;
        let signMd5 = Utils.Md5Encode(signStr);
        return {sign:signMd5, data:requestData};
    }
}